import contextlib


@contextlib.contextmanager
def file_open(file_name):
    print("file onen")
    yield {}
    print("file end")


with file_open("xx.txt") as f_opend:
    print("do some thing")
